<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="copyright" content="www.apicloud.com" />
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>舆情处置中</title>
<link rel="stylesheet" type="text/css" href="../css/api.css" />

<style>
	html {height: 100%;}
	body {height: 100%;width:100%;}
	
	input {height: 50px;font-size: 18px;color: #8E8C8C;width: 80%;}
	input::-webkit-input-placeholder {color: #ccc;} 
	/* 头部样式 */
	 #header{ border-bottom:1px solid #8E8C8C;}
     .topbar {height:50px; border-bottom: 1px solid #DDDFE3; }
     #title { color:#333;}      
     .back {float: left; padding-right: 30px;}
     .back img {height: 30px;margin-top: 10px;margin-left: 10px;margin-bottom: 10px;}
     .topbar .title {line-height: 50px; font-size: 20px;  position: absolute; left: 50%; -webkit-transform: translateX(-50%);transform: translateX(-50%);}
    
    /* 内容样式 */   
	 #main{ width: 100%; height:100%; margin:0px; padding:0px;}
	 #main .select{ width: 100%;  text-align: left; font-size: 1.3em; color: #333; } 
	 #main .option{ width: 90%; margin:0px 5%; margin-top:20px;font-weight:bold;}
	 .condition{width: 90%; margin:10px 5%;padding:0px; font-size: 1em;}
	 .condition>ul{line-height: 36px;}
	 .condition>ul>li{width:100%; text-indent:1em;}
	 .condition .right{ float: right;margin-right:5%; display:none;}
	 #measures{ width:95%; margin:5px 5px 5px 5px; border:1px solid #e0e0e0;border-radius: 5px;padding:2px;line-height:26px; }
 	/*.email, .passwd, .btn {margin:3px 10px;}*/
	.btn {margin:3px 10px;}
	.btn {background: red;color: #fff;height: 40px; text-align: center; line-height: 40px; font-size: 20px;border-radius: 5px;}
 	 
	/* 底部样式 */
	.bottom {/*position: absolute;bottom: 0;*/width: 100%;height:50px; text-align: center;/*padding-bottom: 20px;*/font-size: 12px;}     
 
 
	input {outline: none;}
</style>
</head>
<body>
	<div class="top">	 
		<div id="main">
             <div class="select">
                    <div class="option">已转办：</div>
                    <div class="condition">
                         <input type="hidden" id="area" name="area" value="0">
                         <ul id="ul_area_user_list">
                               
                         </ul>
                    </div>
                      <div class="option">处置措施：</div>
                      <div class="condition" style="text-align:center;width: 95%; margin:10px 10px;">
                         <textarea id="measures" name="measures" cols="28%" rows="5"></textarea>
                      </div>                  
             </div>
		
		</div>
		 
		<div id="clear_5"></div>
		<div class="btn" tapmode="buyhover" onclick="checkform()">提  交</div>
		<input id="access_token" type="hidden" value=""/>
        <input id="admin_id" type="hidden" value=""/>
	</div> 

	<!---------------------------底部信息------------------------------------->
 	<div class="bottom">	 
		 	 		 
	</div>
	<!---------------------------底部信息------------------------------------->
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/api.data.js"></script>
<script type="text/javascript" src="../script/jquery.md5.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript">
   apiready = function() { 
          //关闭底部弹出页面
         api.closeFrame({name: 'operationFrame'});
		//在页面制定位置输出接口所需的access_token和admin_id
        get_sign();  
         //获取头部和底部的相关信息，计算子窗口的高度及y坐标
         header = $api.byId('header');       
         $api.fixIos7Bar(header);     
         headerOffset = $api.offset(header);     
         
         goto_loadAreaListFun();
     }
     
     function goto_loadAreaListFun(){
     
     api.readFile({
                 path:'fs://yqgzpt.txt'
            }, function(ret, err){           
                 var data = $api.strToJson(ret.data);  
                
                 var access_token = data.access_token;                     
		 		var admin_id = data.admin_id;   
		 		
		 		 var sign = faultylabs.MD5(access_token+admin_id+'datas/GetAreaUser1.0syjqingbao');
			 sign = sign.toLowerCase();//将字符串大写转成小写
		 	var url = server_url+'r=datas/GetAreaUser&access_token='+access_token+'&admin_id='+admin_id+'&v=1.0&sign='+sign;                
  
	   		api.ajax({
				url: url,
				method: 'get',
				cache: false,
				timeout: 30,
				dataType: 'json',
				returnAll:false 
				},function(ret,err){
				 
					if (ret) {   
						if("100"==ret.success){  
							for (var idx in ret.list) { 
				        		var module = ret.list[idx];  
								var area_id=module["area_id"];
								var area_name=module["area_name"];
								 
								 
								var listHtml = "<li id='selected_"+area_id+"' onclick='openSelect("+area_id+")'>"+area_name+"<b id='duigou_"+area_id+"' class='right'>√</b></li>";
								$("#ul_area_user_list").append(listHtml);  
							}
							api.hideProgress();
						}else{
							api.alert({title:'系统提示',msg:ret.message});  
							api.hideProgress();
						} 
					}
					else {
						api.alert({title:'系统提示',msg:'错误码：'+err.code+'；错误信息：'+err.msg+'网络状态码：'+err.statusCode}); 
						api.hideProgress();
					};
				});
            });   
     }
    
    //打开地区选择
    function openSelect(id){ 
           //将之前选中的样式复原
           var selected_id = document.getElementById('area').value;  
           if(selected_id != "0"){       
	           document.getElementById('duigou_'+selected_id).style.display = "none"; 
	           document.getElementById('selected_'+selected_id).style.background = "#fff"; 
	           document.getElementById('selected_'+selected_id).style.color = "#333"; 
           }         
           
           //标记处已选中的样式
           if(id != selected_id){
	           document.getElementById('duigou_'+id).style.display = "block";
	           document.getElementById('selected_'+id).style.background = "#e0e0e0"; 
	           document.getElementById('selected_'+id).style.color = "red";          
	           
	           //输出已选中的
	           document.getElementById('area').value = id;
           }else{
               document.getElementById('area').value = "0";
           }
    }
  
    //信息提交
	function checkform () {
        var message_id = api.pageParam.message_id;//获取操作内容id  
        var measures = document.getElementById("measures").value; 
        var area = document.getElementById("area").value;        
        var deal_status = "1";
        var feedback = "";
        var is_media = "";
        var isreal = "";
        if('0'==area||''==measures){
        	api.alert({title:'系统提示',msg:'“已转办”、“处置措施”至少选择一个'});
			return;
        }
       
        api.confirm({
              title: '确认是否提交',
              msg: '提交成功后将返回原信息页面，可返回列表查看提交信息。',
              buttons:['确定', '取消']
        },function(ret,err){
             if(ret.buttonIndex == 1){
                    yqcz_message(message_id,deal_status,measures,feedback,is_media,isreal,area);  
                    api.closeWin({name:'disposalWin'}); 
             }
        });                                                                          
    }
    
    function goback () {
      api.closeWin({name:'disposalWin'});
    }

</script>
</html>